Exploring different research questions via complex multi-state models when using registry-based repeated prescriptions of antidepressants in women with breast cancer and a matched population comparison group

Background Multi-state models are used to study several clinically meaningful research questions. Depending on the research question of interest and the information contained in the data, different multi-state structures and modelling choices can be applied. We aim to explore different research questions using a series of multi-state models of increasing complexity when studying repeated prescriptions data, while also evaluating different modelling choices. Methods We develop a series of research questions regarding the probability of being under antidepressant medication across time using multi-state models, among Swedish women diagnosed with breast cancer (n = 18,313) and an age-matched population comparison group of cancer-free women (n = 92,454) using a register-based database (Breast Cancer Data Base Sweden 2.0). Research questions were formulated ranging from simple to more composite ones. Depending on the research question, multi-state models were built with structures ranging from simpler ones, like single-event survival analysis and competing risks, up to complex bidirectional and recurrent multi-state structures that take into account the recurring start and stop of medication. We also investigate modelling choices, such as choosing a time-scale for the transition rates and borrowing information across transitions. Results Each structure has its own utility and answers a specific research question. However, the more complex structures (bidirectional, recurrent) enable accounting for the intermittent nature of prescribed medication data. These structures deliver estimates of the probability of being under medication and total time spent under medication over the follow-up period. Sensitivity analyses over different definitions of the medication cycle and different choices of timescale when modelling the transition intensity rates show that the estimates of total probabilities of being in a medication cycle over follow-up derived from the complex structures are quite stable. Conclusions Each research question requires the definition of an appropriate multi-state structure, with more composite ones requiring such an increase in the complexity of the multi-state structure. When a research question is related with an outcome of interest that repeatedly changes over time, such as the medication status based on prescribed medication, the use of novel multi-state models of adequate complexity coupled with sensible modelling choices can successfully address composite, more realistic research questions. Supplementary Information The online version contains supplementary material available at 10.1186/s12874-023-01905-9.

is a schematic representation of the duration of a medication cycle based on the observed prescription dates and the 90-day rule. Figure A1. Diagram for antidepressant medication cycles. Time gaps of less than three months between two consecutive prescription dates are depicted in deep purple and time gaps of more than three months with pink. Figure A2. Transition rates ratios for BC cases versus BC-free individuals for the different multi-state structures a) b) *Transition rate models towards and from medication states under the "Emulated bidirectional" do not allow for time varying effects of the being a case, that is why the transition rate ratios are constant across time. The case variable in our analysis is constrained to have the same effect on the transition rates from medication cycles to medication discontinuation periods (and vice versa). That is why all transitions rate ratios lines of BC cases versus BCfree individuals overlap. For the single-event survival analysis and the competing risks setting, the estimated restricted expected length of stay measure relative to experiencing the 1 st antidepressant medication use can be interpreted as the expected medication-free time/ or time before experiencing the 1 st antidepressant medication ( Figure A3a). Regarding the 3-state Illness-Death approach, the interpretation can be either the expected time before experiencing the 1 st antidepressant medication or the life expectancy after experiencing the 1 st antidepressant medication. Under the 4-state unidirectional multi-state model, the estimated restricted expected length of stay can be interpreted as the length of stay in the 1 st medication cycle before moving on to the 1 st discontinuation period or death. Even though BC cases appear to stay in the 1 st antidepressive medication cycle longer than the BC-free individuals, it can be observed that both groups do not tend to stay in the 1 st medication cycle for a long period. As shown in Figure 8 of the main manuscript (sensitivity analysis), the measures derived from the 4-state unidirectional approach are heavily influenced from the definition of the medication cycle. Under the 4-state bidirectional multi-state ( Figure A3b) the restricted expected length of stay in a medication cycle or medication discontinuation period after entering a medication discontinuation state is derived. As discussed above, this structure assumes same transition rates towards medication cycles (or medication discontinuation periods), irrespective of past transitions to those states. Under the recurrent multi-state structure without and with restrictions ("Emulated" bidirectional model), Figure A3c depicts the total restricted expected length of stays in a medication cycle given that an individual just entered her 1 st , 2 nd or 3 rd medication cycle. Figure A4. Comparison of the estimate of populational total probability of being in a medication cycle for different definitions of the medication cycles (3 months versus 4 months versus 5 months) under the different clock approaches for the multistate structures D, E, F and G.
Several conclusions can be drawn from the estimated probabilities of FigureA4. Regarding the 4-state unidirectional model, the estimations from the three alternative clock approaches within each medication cycle definition seem to be very similar. However, as was also shown and discussed in Figure 8 of the main manuscript, the definition of the medication cycle influences the estimated probability of being in the 1 st medication cycle, and this can be observed under all clock approaches. The 4-state bidirectional appears to be less sensitive to the definition of medication cycles. The Clock reset and Clock mix approaches return very similar probability estimates of being in a medication cycle under all medication cycle definitions. However, the Clock forward approach of this structure appears to be more sensitive to the medication cycle definition from times more than 4 years after the start of the follow-up and its probability estimates are not so similar with the ones derived from the Clock reset and Clock mix approaches. The estimated total probability of being in a medication cycle state since the start of follow-up is very similar among all Clock approaches and all medication cycle definitions. The "Emulated bidirectional" structure appears to have low to mild degree of sensitivity to the definition of the medication cycle and the choice of the clock approach used.

Flexible parametric survival models
In this study we used flexible parametric survival models on the log cumulative hazard scale ln( ) with time since entering a state as the timescale . These models use restricted cubic spline functions to flexibly model the effect of the logarithm of the timescale, (ln | , ) for the log baseline cumulative hazard, with knots and parameters . The case status variable is included as , the vector of the age group binary covariates as and their interactions as .
For the transitions towards the death state (medication cycle towards death, medication discontinuation period towards death) a model with 4 for the baseline hazard is used and no time-dependent effects of the case status variable: with the coefficient for the covariate , and the coefficient vector for the age group covariate vector and the coefficient vector of their interaction.
For the transitions towards a non-death state (medication cycle towards medication discontinuation period and vice versa), a model with 4 for the baseline hazard and = 3 (number of time-dependent effects) for the case status variable is used: with, , the knots for the ℎ time-dependent effect with parameters .
Multi-state structure with recurrent couples of medication cycle and discontinuation period states (Corresponds to Structures of Figure 1F and 1G) Let's consider a stochastic process ( ) with state space = 1, . . . , , with State 1 being the starting state of the process (start of follow-up) and being the terminal state (Death). According to the recurrent multistate structure of of Figures 1F and 1G, the even numbered states, = {2, 4, … , − 1} are the medication cycle states (states of primary interest), with the ℎ element of set , and ∈ = {1,2, … , }, being the number of medication cycle states. The uneven states, = {3, 5, . . . , − 2} is the of discontinuation period states, with being the ℎ element of set . Let be the time of prediction (time since start of follow-up), and the time of entering the ℎ medication cycle. We are interested only in estimates either since the start of the follow-up ( = 0) or immediately upon entering the ℎ medication cycle (estimates truncated at ).
We can define the total probability of being in any of the medication cycle states (set of states ) up to time since since the start of follow-up as: We can similarly define the total restricted expected length of stay in the ℎ medication cycle and all subsequent medication cycles across time given entering the ℎ cycle at time , by integrating from to the transition probability of equation 5: ∫ ∑ ( ( ) = + | ( ) = ) + ∈ + 0 (7) As in the main analysis of the study we use a semi-Markov ("clock reset") multi-state model, the predictions (transition probabilities and restricted expected length of stay measures) made on the time since start of follow-up given entering the ℎ medication cycle state at time , can also be reported as predictions made from time since entering each medication cycle state state up to − .